class AxisX {
	constructor (param) {
		this.fontSize = param.fontSize || 20;
		this.text = param.text;
		this.x = param.x || 0;
		this.y = param.y || 0;
		this.color = param.color || '#eee';
	}

	draw (ctx) {
		ctx.setFillStyle(this.color);
		ctx.setFontSize(this.fontSize);
		ctx.setTextAlign('center');
		ctx.fillText(this.text, this.x, this.y);
	}

	static drawUnit (ctx, unit, x, y) {
		ctx.fillText(unit, x, y);
	}
}

module.exports = AxisX;